﻿Public Class xtf_LISTADOliquidacion_

    Public Overrides Sub IniciarLista()
        Try
            gdc_general.BeginUpdate()
            gdc_general.DataSource = dtt_DataTable
            'ulg_Lista.DisplayLayout.GroupByBox.Style = Infragistics.Win.UltraWinGrid.GroupByBoxStyle.Full

            'Creacion y carga de Cuentas
            dtt_DataTable.Columns.Add("Identificador (ID)")
            dtt_DataTable.Columns.Add("Fecha", GetType(DateTime))

            gdv_general.PopulateColumns(dtt_DataTable)

            Dim obj_liquidacion_ As New cls_liquidacion_
            If obj_liquidacion_.CargarTodos(ObtenerRegistroEstado) Then
                For Each liquidacion As cls_liquidacion_ In obj_liquidacion_.Items
                    AgregarItem(liquidacion)
                Next
            End If
            'ulg_Lista.DataBind()

            FiltrarColumnas()
            gdc_general.EndUpdate()
        Catch ex As Exception
            'Dim frmError As New frm_ErrorManager(ex.Message)
        End Try
    End Sub

    Public Function AgregarItem(ByRef liquidacion As cls_liquidacion_) As DataRow
        If UsuarioLOG.esroot = True Or liquidacion.idliquidacion <> 1 Then
            Dim Row As DataRow = dtt_DataTable.NewRow
            Row("Identificador (ID)") = liquidacion.idliquidacion
            Row("Fecha") = liquidacion.fecha

            dtt_DataTable.Rows.Add(Row)
            'ulg_Lista.Rows(ulg_Lista.Rows.Count - 1).Height = 19
            Return Row
        End If
    End Function

    Public Sub ModificarItem(ByRef liquidacion As cls_liquidacion_, ByRef ulg_row As DataRow)
        ulg_row("Identificador (ID)") = liquidacion.idliquidacion
        ulg_row("Fecha") = liquidacion.fecha
    End Sub

    Public Sub New()

        Me.Cursor = Cursors.WaitCursor
        InitializeComponent()
        PERMISONuevo = "001071002"
        PERMISOModificar = "001071003"
        PERMISOEliminar = "001071004"
        PERMISOImprimir = "001071005"
        Me.Text = lbl_modulo.Text : lbl_modulodescripcion.Text = "Listado de " & lbl_modulo.Text & "."
        IniciarLista()
        Me.Cursor = Cursors.Default

    End Sub



End Class